package com.gg.hc.controller;

import com.gg.common.pojo.MDesignProcedure;
import com.gg.hc.search.PageVo;
import com.gg.hc.service.MDesignProcedureService;
import com.gg.hj.util.INumber;
import com.github.pagehelper.Page;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class MDesignProcedureController {
    @Resource
    private MDesignProcedureService mDesignProcedureService;
    @Resource
    private INumber iNumber;
    @ResponseBody
    @RequestMapping("/AddMDesignProcedure.action")
    public int AddMDesignProcedure(@RequestBody MDesignProcedure mDesignProcedure) throws Exception {
        mDesignProcedure.setDesignId(iNumber.number("201"));
        mDesignProcedureService.AddMDesignProcedure(mDesignProcedure);
        return mDesignProcedure.getId();
    }

    @ResponseBody
    @RequestMapping("/queryMDesignProcedureAll.action")
    public PageVo<MDesignProcedure> queryMDesignProcedureAll(@RequestBody PageVo pageVo){
       return mDesignProcedureService.queryMDesignProcedureAll(pageVo);
    }
    @ResponseBody
    @RequestMapping("/QueryMDesignProcedureAll.action")
    public PageVo<MDesignProcedure> QueryMDesignProcedureAll(@RequestBody PageVo pageVo){
       return mDesignProcedureService.QueryMDesignProcedureAll(pageVo);
    }
    @ResponseBody
    @RequestMapping("/queryMDesignProcedureSupplies.action")
    public PageVo<MDesignProcedure> queryMDesignProcedureSupplies(@RequestBody PageVo pageVo){
       return mDesignProcedureService.queryMDesignProcedureSupplies(pageVo);
    }

    @ResponseBody
    @RequestMapping("/UpdateMDesignProcedureCheckTag.action")
    public int UpdateMDesignProcedureCheckTag(@RequestBody MDesignProcedure mDesignProcedure){
        mDesignProcedureService.UpdateMDesignProcedureCheckTag(mDesignProcedure);
        return 1;
    }
    @ResponseBody
    @RequestMapping("/UpdateMDesignProcedureSuppliesCheckTag.action")
    public int UpdateMDesignProcedureSuppliesCheckTag(@RequestBody MDesignProcedure mDesignProcedure){
        mDesignProcedureService.UpdateMDesignProcedureSuppliesCheckTag(mDesignProcedure);
        return 1;
    }
    @ResponseBody
    @RequestMapping("/UpdateMDesignProcedureNoPass.action")
    public int UpdateMDesignProcedureNoPass(@RequestBody MDesignProcedure mDesignProcedure){
        mDesignProcedureService.UpdateMDesignProcedureNoPass(mDesignProcedure);
        return 1;
    }
    @ResponseBody
    @RequestMapping("/UpdateMDesignProcedureSuppliesNoPass.action")
    public int UpdateMDesignProcedureSuppliesNoPass(@RequestBody MDesignProcedure mDesignProcedure){
        mDesignProcedureService.UpdateMDesignProcedureSuppliesNoPass(mDesignProcedure);
        return 1;
    }
    @ResponseBody
    @RequestMapping("/queryByDesignModuleTag.action")
    public PageVo<MDesignProcedure> queryByDesignModuleTag(@RequestBody PageVo pageVo){
           return mDesignProcedureService.queryByDesignModuleTag(pageVo);
    }
    @ResponseBody
    @RequestMapping("/updateDesignModuleTagById.action")
    public int updateDesignModuleTagById(Integer id){
           return mDesignProcedureService.updateDesignModuleTagById(id);
    }

    @ResponseBody
    @RequestMapping("/QueryMDesignProcedureSuppliesAll.action")
    public PageVo<MDesignProcedure> QueryMDesignProcedureSuppliesAll(@RequestBody PageVo pageVo){
        return mDesignProcedureService.QueryMDesignProcedureSuppliesAll(pageVo);
    }
    @ResponseBody
    @RequestMapping("/updateMDesignProcedureModuleCostPriceSum.action")
    public int updateMDesignProcedureModuleCostPriceSum(@RequestBody MDesignProcedure mDesignProcedure){
        System.out.println("进来了");
        return mDesignProcedureService.updateMDesignProcedureModuleCostPriceSum(mDesignProcedure);
    }
    @ResponseBody
    @RequestMapping("/updateMDesignProcedureSuppliesTag.action")
    public int updateMDesignProcedureSuppliesTag(String designId){
        return mDesignProcedureService.updateMDesignProcedureSuppliesTag(designId);
    }@ResponseBody
    @RequestMapping("/updateCostPriceSumById.action")
    public int updateMDesignProcedureSuppliesTag(@RequestBody MDesignProcedure mDesignProcedure){
        return mDesignProcedureService.updateCostPriceSumById(mDesignProcedure);
    }
}
